package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.CommentMaintainService;
import com.ai.web.vo.CommentMaintainV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.CommentMaintain;
import com.tiny.persistence.repository.CommentMaintainRepo;

@Service
public class CommentMaintainServiceImpl extends BaseServiceImpl<CommentMaintain, Integer, CommentMaintainV> implements CommentMaintainService  {

    @Autowired
    private CommentMaintainRepo commentMaintainRepo;
    
    @Autowired
    public CommentMaintainServiceImpl(CommentMaintainRepo commentMaintainRepo) {
        super(commentMaintainRepo);
    }

    public CommentMaintainV getCommentMaintain(int userId) throws Exception {
        return getT(userId);
    }

    public ResultModel saveCommentMaintain(CommentMaintainV commentMaintainV) throws Exception {
        
        CommentMaintainV saveV = saveT(commentMaintainV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteCommentMaintains(List<Integer> userIds) throws Exception {
        deleteTs(userIds);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }

}
